/* GUI CONVERTED from rcrsup.p (converter v1.76) Wed May 29 12:00:57 2002 */
/* rcrsup.p - Release Management Customer Schedules                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.6.3.6 $                                                 */
/*V8:ConvertMode=FullGUIReport                                          */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92           BY: WUG *F110*    */
/* REVISION: 7.0    LAST MODIFIED: 03/16/92           BY: WUG *F312*    */
/* REVISION: 7.0    LAST MODIFIED: 03/26/92           BY: WUG *F606*    */
/* REVISION: 7.3    LAST MODIFIED: 10/06/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 10/06/94           BY: dpm *GN13*    */
/* REVISION: 7.3    LAST MODIFIED: 07/22/96     BY: *G29C* Ajit Deodhar */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 08/19/99   BY: *N01B* Mugdha Tambe       */
/* REVISION: 9.1      LAST MODIFIED: 05/20/99   BY: *N004* Patrick Rowan      */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.6.3.5     BY: Katie Hilbert      DATE: 04/15/02   ECO: *P03J*  */
/* $Revision: 1.6.3.6 $    BY: Katie Hilbert      DATE: 04/15/02   ECO: *P06T*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* REQUIRED SCHEDULE UPDATE */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

/* PREPROCESSOR USED FOR REPORTS WITH SIMULATION OPTION */
&SCOPED-DEFINE simulation true
{rcrpvar.i "new shared"}
define new shared variable report_yn           like mfc_logical
                                               label "Report Detail/Summary"
                                               format "Detail/Summary".
/* DEFAULT VALUE FOR UPDATE_YN IS CHANGED FROM YES TO NO            */
/* SINCE IT IS RECOMMENDED APPROACH IN HELP DOCUMENTATION           */
define new shared variable update_yn           like mfc_logical
                                               label "Update" no-undo.
define new shared variable audit_yn            like mfc_logical.
define new shared variable warn_ct             as integer no-undo.
define new shared variable using_seq_schedules like mfc_logical
                                               initial no no-undo.
define new shared stream audit.

/* VARIABLE DEFINITIONS FOR gpfile.i */
{gpfilev.i}


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
shipfrom_from        colon 15 label "Ship-From"
   shipfrom_to          colon 45 label {t001.i}
   cust_from            colon 15
   cust_to              colon 45 label {t001.i}
   shipto_from          colon 15
   shipto_to            colon 45 label {t001.i}
   dock_from            colon 15
   dock_to              colon 45 label {t001.i}
   part_from            colon 15
   part_to              colon 45 label {t001.i}
   po_from              colon 15 format "x(22)"
   po_to                colon 45 label {t001.i} format "x(22)"
   custref_from         colon 15 format "x(22)"
   custref_to           colon 45 label {t001.i} format "x(22)"
   modelyr_from         colon 15
   modelyr_to           colon 45 label {t001.i}
   order_from           colon 15
   order_to             colon 45 label {t001.i}
   skip(1)
   report_yn            colon 35
   update_yn            colon 35
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/* DETERMINE IF SEQUENCED SCHEDULES ARE INSTALLED */
{gpfile.i &file_name = """"rcf_ctrl""""}
if can-find (mfc_ctrl where mfc_field = "enable_sequence_schedules"
             and mfc_logical) and file_found
then
   using_seq_schedules = yes.


/*GUI*/ {mfguirpa.i true "printer" 80 " " " " " "  }

/*GUI repeat  with frame a: */
/*GUI*/ procedure p-enable-ui:

   /*GUI: view frame dtitle. */
IF global-tool-bar AND global-tool-bar-handle ne ? THEN
  view global-tool-bar-handle. /*GUI*/

   warn_ct = 0.

   if shipfrom_to = hi_char then shipfrom_to = "".
   if cust_to     = hi_char then cust_to     = "".
   if shipto_to   = hi_char then shipto_to   = "".
   if dock_to     = hi_char then dock_to     = "".
   if part_to     = hi_char then part_to     = "".
   if po_to       = hi_char then po_to       = "".
   if custref_to  = hi_char then custref_to  = "".
   if modelyr_to  = hi_char then modelyr_to  = "".
   if order_to    = hi_char then order_to    = "".

   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   bcdparm = "".
   {mfquoter.i shipfrom_from}
   {mfquoter.i shipfrom_to }
   {mfquoter.i cust_from   }
   {mfquoter.i cust_to     }
   {mfquoter.i shipto_from }
   {mfquoter.i shipto_to   }
   {mfquoter.i dock_from   }
   {mfquoter.i dock_to     }
   {mfquoter.i part_from   }
   {mfquoter.i part_to     }
   {mfquoter.i po_from     }
   {mfquoter.i po_to       }
   {mfquoter.i custref_from}
   {mfquoter.i custref_to  }
   {mfquoter.i modelyr_from}
   {mfquoter.i modelyr_to  }
   {mfquoter.i order_from  }
   {mfquoter.i order_to    }
   {mfquoter.i report_yn   }
   {mfquoter.i update_yn   }

   if  shipfrom_to = "" then shipfrom_to = hi_char.
   if  cust_to     = "" then cust_to     = hi_char.
   if  shipto_to   = "" then shipto_to   = hi_char.
   if  dock_to     = "" then dock_to     = hi_char.
   if  part_to     = "" then part_to     = hi_char.
   if  po_to       = "" then po_to       = hi_char.
   if  custref_to  = "" then custref_to  = hi_char.
   if  modelyr_to  = "" then modelyr_to  = hi_char.
   if  order_to    = "" then order_to    = hi_char.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 80 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   audit_yn = no.

   if not batchrun then do:
      if path <> "terminal" then do:
         output stream audit to terminal.
         audit_yn = yes.
      end.
   end.
   {mfphead2.i}

   {gprun.i ""rcrsupa.p""}

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


   if audit_yn then output stream audit close.

   if warn_ct > 0 then do:
      /* Warning messages produced */
      {pxmsg.i &MSGNUM=8222 &ERRORLEVEL=2 &MSGARG1=warn_ct}
   end.
end.

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" shipfrom_from shipfrom_to cust_from cust_to shipto_from shipto_to dock_from dock_to part_from part_to po_from po_to custref_from custref_to modelyr_from modelyr_to order_from order_to report_yn update_yn "} /*Drive the Report*/
